<?php
	if ($act == 'create'){
		if (isset($_POST['file']) && ($_POST['file'] == 'file')) $res = $backupclass->create_backup('file');
		else $res = $backupclass->create_backup();
		if ($res != 0) $err->AddError($res, 'backup');
	} elseif ($act == 'delete'){
		if (isset($_POST['file']) && (strlen($_POST['file']) > 6)){
			$res = $backupclass->delete_file($_POST['file']);
			if ($res != 0) $err->AddError($res, 'backup');
		}
	} elseif ($act == 'download'){
		if (isset($_POST['file']) && (strlen($_POST['file']) > 6)){
			$res = $backupclass->download_file($_POST['file']);
			if ($res != 0) $err->AddError($res, 'backup');
		}
	} elseif ($act == 'restore'){
		if (isset($_POST['file']) && (strlen($_POST['file']) > 6)){
			$res = $backupclass->restore_backup($_POST['file']);
			if ($res != 0) $err->AddError($res, 'backup');
		}
	} elseif ($act == 'upload'){
		if (isset($_FILES['file'])){
			$res = $backupclass->upload_file($_FILES['file']);
			if ($res != 0) $err->AddError($res, 'backup');
		}
	}
?>